/**
 * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
 */
package com.jeesite.modules.zx.certificate.entity;

import org.hibernate.validator.constraints.Length;

import com.jeesite.common.entity.DataEntity;
import com.jeesite.common.mybatis.annotation.Column;
import com.jeesite.common.mybatis.annotation.JoinTable;
import com.jeesite.common.mybatis.annotation.JoinTable.Type;
import com.jeesite.common.mybatis.annotation.Table;
import com.jeesite.common.mybatis.mapper.query.QueryType;
import com.jeesite.modules.zx.user.entity.ZxUser;

/**
 * 证书管理Entity
 * @author zpp
 * @version 2020-02-20
 */
@Table(name="t_certificate", alias="a", columns={
		@Column(name="id", attrName="id", label="主键", isPK=true),
		@Column(name="certificate", attrName="certificate", label="证书"),
		@Column(name="user_id", attrName="userId", label="用户标识"),
		@Column(includeEntity=DataEntity.class),
	},joinTable={
		@JoinTable(type=Type.LEFT_JOIN,alias = "u", attrName="zxUser", entity = ZxUser.class, on = "a.user_id=u.user_code",columns={
			@Column(includeEntity=ZxUser.class)	
		})
	}, orderBy="a.update_date DESC"
)
public class Tcertificate extends DataEntity<Tcertificate> {
	
	private static final long serialVersionUID = 1L;
	private String certificate;		// 证书
	private String userId;		// 用户标识
	private ZxUser zxUser=new ZxUser();
	
	public ZxUser getZxUser() {
		return zxUser;
	}

	public void setZxUser(ZxUser zxUser) {
		this.zxUser = zxUser;
	}

	public Tcertificate() {
		this(null);
	}

	public Tcertificate(String id){
		super(id);
	}
	
	@Length(min=0, max=500, message="证书长度不能超过 500 个字符")
	public String getCertificate() {
		return certificate;
	}

	public void setCertificate(String certificate) {
		this.certificate = certificate;
	}
	
	@Length(min=0, max=50, message="用户标识长度不能超过 50 个字符")
	public String getUserId() {
		return userId;
	}

	public void setUserId(String userId) {
		this.userId = userId;
	}
	
}